add_action( 'template_redirect', 'single_result' );
function single_result() {
	if ( ! is_search() ) {
		return;
	}

	global $wp_query;

	if ( $wp_query->post_count == 1 ) {
		wp_redirect( get_permalink( reset( $wp_query->posts )->ID ) );
		die;
	}
}